#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

typedef pair<int,int> pii;
#define dist first
#define id second

int f[12];
int dist[][9]={
{0,1,2,1,2,3,2,3,4},
{1,0,1,2,1,2,3,2,3},
{2,1,0,3,2,1,4,3,2},
{1,2,3,0,1,2,1,2,3},
{2,1,2,1,0,1,2,1,2},
{3,2,1,2,1,0,3,2,1},
{2,3,4,1,2,3,0,1,2},
{3,2,3,2,1,2,1,0,1},
{0,0,0,0,0,0,0,0,0}
};
bool CanSlove(char* st)
{
    int cnt = 0;
    REP(i,9) REP(j,i)
    {
        if(st[j]>st[i]&&st[j]!=9) cnt++;
    }
    return cnt&1^1;
}
int StringToId(char* st)
{
    int ans = 0;
    REP(i,9)
    {
        int cnt = 0;
        REP(j,i) if(st[j]<st[i]) cnt++;
        ans += (st[i]-1-cnt)*f[8-i];
    }
    return ans;
}
void IdToString(int id,char *ans,int len=9)
{
    bool done[10];
    REP(i,10) done[i] = false;
    REP(i,len)
    {
        int t = id/f[len-1-i];
        int cnt = 0,pos;
        REP(j,9) if(!done[j])
        {
            pos = j;
            if(++cnt==t+1) break;
        }
        ans[i]=pos+1;
        done[pos] = true;
        id%=f[len-1-i];
    }
    return ;
}
int GetDist(char* st)
{
    int sum = 0;
    REP(i,9) sum+=dist[st[i]-1][i];
    return sum;
}
void init()
{
    f[0] = 1;
    FOR(i,1,10) f[i] = f[i-1]*i;
}
char dir[362881];
int father[362881];
void GetAns(char* st)
{
    int ss = StringToId(st);
    int tt = 0;
    vector<int> done(362881,-1);
    priority_queue<pii,vector<pii>,greater<pii> > q;
    done[ss] = GetDist(st);
    if(!CanSlove(st))
    {
        puts("unsolvable");
        return ;
    }
    q.push(pii(done[ss],ss));
    char now[10];
    char t[10];
    father[tt] = -1;
    while(!q.empty())
    {
        int vs = q.top().id;q.pop();
        IdToString(vs,now);
       // REP(i,9) printf("%d",now[i]);
       // cout<<endl;
        int pos = 0;
        REP(i,9) if(now[i]==9)
        {
            pos = i;break;
        }
        if(pos%3!=2)
        {
            memcpy(t,now,sizeof(t));
            swap(t[pos],t[pos+1]);
            int id = StringToId(t);
            if(done[id]==-1)
            {
                father[id] = vs;
                dir[id] = 'r';
                if(id==tt) break;
                q.push(pii(done[id]=GetDist(t),id));
            }
        }
        if(pos<6)
        {
            memcpy(t,now,sizeof(t));
            swap(t[pos],t[pos+3]);
            int id = StringToId(t);
            if(done[id]==-1)
            {
                father[id] = vs;
                dir[id] = 'd';
                if(id==tt) break;
                q.push(pii(done[id]=GetDist(t),id));
            }
        }
        if(pos%3>0)
        {
            memcpy(t,now,sizeof(t));
            swap(t[pos],t[pos-1]);
            int id = StringToId(t);
            if(done[id]==-1)
            {
                father[id] = vs;
                dir[id] = 'l';
                if(id==tt) break;
                q.push(pii(done[id]=GetDist(t),id));
            }
        }
        if(pos>2)
        {
            memcpy(t,now,sizeof(t));
            swap(t[pos],t[pos-3]);
            int id = StringToId(t);
            if(done[id]==-1)
            {
                father[id] = vs;
                dir[id] = 'u';
                if(id==tt) break;
                q.push(pii(done[id]=GetDist(t),id));
            }
        }
       // delete(now);
    }
    vector<char> ans;
    for(int pos=tt;pos!=ss;pos=father[pos])
    {
        ans.push_back(dir[pos]);
    }
    for(int i=ans.size()-1;i>=0;--i) putchar(ans[i]);
    cout<<endl;
}
int main()
{
    init();
    int n = 9;
    char s[10];
    //REP(i,9) REP(j,9) if(dist[i][j]!=dist[j][i]) printf("%d %d\n",i,j);
   // REP(i,9) scanf("%s",s+i);
    while(true)
    {
        REP(i,9) if(scanf("%s",s+i)==EOF) return 0;
        REP(i,9)
            if(s[i]=='x') s[i] = 9;
            else s[i]-='0';
        GetAns(s);
    }
    return 0;
}
